package com.vnaloha.common.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.vnaloha.common.service.ProductService;


@Controller
@RequestMapping("home")
public class HomeController {
	
	@Autowired
	private ProductService productService;
	
	@RequestMapping(method = RequestMethod.GET)
	public String index(ModelMap modelMap) {
		
		try {
			modelMap.addAttribute("list", productService.list());
		} catch (Exception e) {
			
		}
		return "user/home";
	}
}
